<template>
  <div id="app">
    <img src="img/01.gif" alt="" width="100%" />
    <div class="title" @click="home()">随便看看</div>
    <div class="title2" @click="reg()">立即登录</div>
    <div class="title3"><span id="num">5</span>S</div>
  </div>
</template>

<style lang="less" scoped>
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  list-style: none;
  text-decoration: none;
  outline: none;
}
.title2 {
  position: absolute;
  bottom: 64px;
  right: 39px;
  width: 130px;
  text-align: center;
  height: 40px;
  line-height: 40px;
  background-color: #2d292394;
  border-radius: 20px;
  color: white;
  font-size: 16px;
}
.title {
  position: absolute;
  bottom: 64px;
  left: 39px;
  width: 130px;
  text-align: center;
  height: 40px;
  line-height: 40px;
  background-color: #2d292394;
  border-radius: 20px;
  color: white;
  font-size: 16px;
}
.title3 {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  text-align: center;
  height: 30px;
  line-height: 30px;
  background-color: #2d292394;
  border-radius: 50%;
  color: white;
}
</style>

<script>
// import func from '../../vue-temp/vue-editor-bridge';
export default {
  data() {
    return {
      nav: [],
      time: "",
      msg: {},
    };
  },
  watch: {},
  methods: {
    home() {
      clearInterval(this.time);
      this.$router.push({ path: "/Home" });
    },
    reg() {
      clearInterval(this.time);
      this.$router.push({ path: "/Login" });
    },
  },
  mounted() {
    var a = document.getElementById("num");
    var num = a.innerText;
    this.time = setInterval(() => {
      num--;
      a.innerText = num;
      if (num == 0) {
        this.$router.push({ path: "/Home" });
      }
    }, 1500);
    console.log(num);
  },
};
</script>
